package command;

import machine.AgriculturalMachine;

public class StopMachineCommand implements Command{
    private final AgriculturalMachine machine;

    public StopMachineCommand(AgriculturalMachine machine) {
        this.machine = machine;
    }

    @Override
    public void execute() {
        System.out.println("执行命令: 停止 " + machine.getMachineId());
        machine.stop();
    }

    @Override
    public void undo() {
        System.out.println("撤销命令: 启动 " + machine.getMachineId());
        machine.start();
    }

    @Override
    public String getDescription() {
        return "停止设备 " + machine.getMachineId();
    }
}
